﻿<UserControl x:Class="TrackMe.View.Frames.CreateView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:apps="clr-namespace:TrackMe.Apps.VM;assembly=TrackMe.Apps" 
             xmlns:beh="clr-namespace:TrackMe.View.Behaviours" 
             mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance apps:CreateVM}"
             d:DesignHeight="264" 
             d:DesignWidth="358">
	<Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="3" />
            <ColumnDefinition Width="50*" />
        </Grid.ColumnDefinitions>
        
        <DockPanel Grid.Column="0">
            <ToolBar DockPanel.Dock="Top" Height="28" Background="{x:Null}">
                <Button Content="Add Prj" Command="{Binding AddProjectCmd}"/>
                <Button Content="Add Task" Command="{Binding AddTaskCmd}"/>
            </ToolBar>
            <ListBox 
                x:Name="Projects"
                ItemsSource="{Binding Projects}"
                ItemTemplate="{DynamicResource ProjectForList}"
                beh:ListBoxBehaviourScrollSelectedIntoView.Active="True"
                SelectedValue="{Binding Path=SelectedProject, Mode=TwoWay}">
            </ListBox>
        </DockPanel>
        
        <GridSplitter Grid.Column="1" Grid.Row="0" Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
        VerticalAlignment="Stretch" />
        <ListBox 
            x:Name="Tasks"
            ItemsSource="{Binding Tasks}"
            ItemTemplate="{DynamicResource TaskForList}"
            beh:ListBoxBehaviourScrollSelectedIntoView.Active="True"
            SelectedValue="{Binding Path=SelectedTask, Mode=TwoWay}"
            Grid.Column="2"/>
    </Grid>
</UserControl>
